﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Domain.Specification.Core;
using Domain.Entities;

namespace Domain.Specification.User
{
    /// <summary>
    /// 活动用户列表中查询参数的规约
    /// </summary>
    public class UserActiveSpecification : Specification<WebManageUsers>
    {
        int? _Status;
        public UserActiveSpecification(int? status)
        {
            _Status = status;
        }
        public override System.Linq.Expressions.Expression<Func<WebManageUsers, bool>> SatisfiedBy()
        {
            Specification<WebManageUsers> spec = new TrueSpecification<WebManageUsers>();
            if (_Status.HasValue)
                spec &= new DirectSpecification<WebManageUsers>(o => o.Status == (_Status.Value));
            return spec.SatisfiedBy();
        }
    }
}
